#ifndef CMM_THROW_ERROR_H
#define CMM_THROW_ERROR_H
#include <cstdio>
#include <cstdlib>
void prog_error(int point,int number);//program feedback
void prog_error(int point,int number){
	/*
	number:
	0:Working correctly.
	1:Filed to open the file.
	2:Empty file.
	3:Can't find main function.
	4:Mismatched braces.
	5:Mismatched parentheses.
	6:Unknow parameter.
	7:Mismatched code comments.
	8:Mismatched quotes.
	default:Unknow error.
	*/
	if(number==0)exit(0);
	printf("[Error] Point:%d  ",point);
	switch(number){
		case 0:{
			break;
		}
		case 1:{
			printf("Filed to open the file.");
			break;
		}
		case 2:{
			printf("Empty file.");
			break;
		}
		case 3:{
			printf("Can't find start function.");
			break;
		}
		case 4:{
			printf("Mismatched braces.");
			break;
		}
		case 5:{
			printf("Mismatched parentheses.");
			break;
		}
		case 6:{
			printf("Unknow parameter.");
			break;
		}
		case 7:{
			printf("Mismatched code comments.");
			break;
		}
		case 8:{
			printf("Mismatched quotes.");
			break;
		}
		default:{
			printf("Unknow error.");
			break;
		}
	}
	exit(number);
}
#endif /*!H*/
